/**
 * ACM模式代码
 */
import java.util.*;

public class TwoSumACM{
    public int[] twoSumN(int[] nums,int target){
        Map<Integer,Integer>hashtable = new HashMap<Integer, Integer>();
        for(int i = 0;i<nums.length;i++){
            if(hashtable.containsKey(target - nums[i])){
                return new int[]{hashtable.get(target - nums[i]),i};
            }
        }
        return new int[0];
    }

    public static void main(String[] args) {
        //创建Scanner对象用于读取输入
        Scanner scanner = new Scanner(System.in);
        //读取数组长度
        int n = scanner.nextInt();
        //创建数组
        int[]nums = new int[n];
        //存入输入的数字
        for(int i =0;i<n;i++){
            nums[i] = scanner.nextInt();
        }
        //读取目标值
        int target = scanner.nextInt();
        //创建TwoSum类的实例
        TwoSumACM solver = new TwoSumACM ();
        //返回结果
        int[] result = solver.twoSumN(nums, target);
        //输出
        if(result.length == 2){
            System.out.println(result[0]+" "+result[1]);
        }else{
            System.out.println("No solution");

        }
        //关闭scanner对象
        scanner.close();
    }

}
